package net.jueb.frameworkDemo.orm.redis.queue.unPersistent;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import redis.clients.jedis.JedisPubSub;

public class PrintListener extends JedisPubSub{
	
	protected Logger log=LoggerFactory.getLogger(getClass());
	
	@Override
	public void onMessage(String channel, String message) {
		log.debug("收到消息,channle="+channel+",message="+message);
		//此处我们可以取消订阅
		if(message.equalsIgnoreCase("quit")){
			this.unsubscribe(channel);
			log.debug("取消订阅:"+channel);
		}
	}
}